package learn1;

// 测试Collection的contains方法
import java.util.ArrayList;
import java.util.Collection;

public class test {
    public static void main(String[] args) {
        Student s1 = new Student("张三", 18);
        Student s2 = new Student("李四", 19);
        Student s3 = new Student("王五", 20);

        //创建Collection对象
        Collection<Student> c = new ArrayList<Student>();
        c.add(s1);
        c.add(s2);
        c.add(s3);

        Student s4 = new Student("王五", 20);

        System.out.println(c.contains(s4));

        int i = c.size();

    }
}
